﻿Imports System.Data.SqlClient


Public Class QuanBUS
    Public Shared Function GetAllQuanBUS() As DataTable

        Return QuanDAO.GetAllQuanDAO()
    End Function
    Public Shared Function GetMaQuanBUS() As DataTable

        Return QuanDAO.GetMaQuanDAO()
    End Function
    Public Shared Function InsertQuanBUS(ByVal quan As QuanDTO) As Integer
        If (frmQuan.SoCongTyToiDaMoiQuan < quan.SoCongTyToiDaMoiQuan) Then
            Return 0
        Else
            QuanDAO.InsertQuanDAO(quan)
        End If
        Return 1
    End Function

    Public Shared Function UpdateQuanBUS(ByVal quan As QuanDTO) As Integer
        If (frmQuan.SoCongTyToiDaMoiQuan < quan.SoCongTyToiDaMoiQuan) Then
            Return 0
        Else
            QuanDAO.UpdateQuanDAO(quan)
        End If
        Return 1
    End Function
    Public Shared Sub DeleteQuanBUS(ByVal MaQuan As Integer)
        QuanDAO.DeleteQuanDAO(MaQuan)

    End Sub

End Class
